package com.educatioin.manage.web.system.repository;

import com.educatioin.manage.web.system.po.CustomerProductCollectPo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

import java.util.List;

/**
 * Created by BensonZc on 2018/5/4.
 */
@RepositoryRestResource(collectionResourceRel = "customerProductCollectRespository", path = "customerProductCollectRespository")
public interface CustomerProductCollectRespository  extends JpaSpecificationExecutor<CustomerProductCollectPo>, PagingAndSortingRepository<CustomerProductCollectPo, Long> {

    CustomerProductCollectPo findByCustomerIdAndProductId(Long customerId, Long productId);

    List<CustomerProductCollectPo> findByCustomerId(Long customerId);
}
